import React, { Component } from 'react';
import { Form, Input, Button, Select } from 'antd';
import {FormOne} from "../interface/oneFace";


export default class FormOther extends Component<FormOne, any>{
    layout = {
        labelCol: { span: 5 },
        wrapperCol: { span: 15 },
    };

    changeTab = () => {
        this.props.changeTab(1);
    }

    onFinish = (value: any) => {
        let nextData:FormOne = {...this.props, ...value};
        delete nextData.changeTab;
        delete nextData.setForm;
        delete nextData.submit;
        this.props.submit(nextData);
        // this.props.changeTab(2);
        // this.props.setForm(nextData);
    };

    render() {
        return (
            <Form onFinish={this.onFinish} {...this.layout}>
                <Form.Item name='remark' label="remark" rules={[{ required: true }]}>
                    <Input />
                </Form.Item>
                <Form.Item wrapperCol={{ ...this.layout.wrapperCol, offset: 8 }}>
                    <Button onClick={this.changeTab} className="cancalBtn">上一步</Button>
                    <Button type="primary" htmlType="submit">
                        完成
                    </Button>
                </Form.Item>
            </Form>
        )
    }
}
